package com.wac.data;

import com.wac.data.Intercepter.Interceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class interceptorConfig implements WebMvcConfigurer {

	@Resource
	private Interceptor interceptor;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		String[] pathPatterns = {
				"/article/issue",
				"/dynamic/issue",
				"/criticism/add",
				"/like/add",
				"/state/toFollow",
				"/state/addView",
				"/upload/**",
				"/user/loginOut",
				"/user/update/**",
				"/comment/add"

		};
		registry.addInterceptor(interceptor).addPathPatterns(pathPatterns);
	}
}
